using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WebFoundation;

namespace MHI.InspectionManager.Interfaces
{
	/// <summary>
	/// DevJobworksheetT,table entity:dev_jobworksheet_t 
	/// </summary>
	public class DevJobworksheetT
	{
		public static readonly string KeyId;
		public static readonly string KeyParentJob;
		public static readonly string KeyJobCode;
		public static readonly string KeyJobName;
		public static readonly string KeyJobLevel;
		public static readonly string KeyJobType;
		public static readonly string KeyJobSubtype;
		public static readonly string KeyJobTeam;
		public static readonly string KeyJobPerson;
		public static readonly string KeyJobStatus;
		public static readonly string KeyJobStarttime;
		public static readonly string KeyJobEndtime;
		public static readonly string KeyJobFlag;
		public static readonly string KeyVerifyPerson;
		public static readonly string KeyJobHour;
		public static readonly string KeyJobCost;
		public static readonly string KeyJobDevicestop;
		public static readonly string KeyPersonCreated;
		public static readonly string KeyGmtCreated;
		public static readonly string KeyPersonModified;
		public static readonly string KeyGmtModified;
		public static readonly string KeyStateInfo;
		public static readonly string KeyIsUse;
		public static readonly string KeyVersion;
		

		static DevJobworksheetT()
		{
			KeyId = ExpressionHelper.GetPropertyName<DevJobworksheetT>(r => r.Id);
			KeyParentJob = ExpressionHelper.GetPropertyName<DevJobworksheetT>(r => r.ParentJob);
			KeyJobCode = ExpressionHelper.GetPropertyName<DevJobworksheetT>(r => r.JobCode);
			KeyJobName = ExpressionHelper.GetPropertyName<DevJobworksheetT>(r => r.JobName);
			KeyJobLevel = ExpressionHelper.GetPropertyName<DevJobworksheetT>(r => r.JobLevel);
			KeyJobType = ExpressionHelper.GetPropertyName<DevJobworksheetT>(r => r.JobType);
			KeyJobSubtype = ExpressionHelper.GetPropertyName<DevJobworksheetT>(r => r.JobSubtype);
			KeyJobTeam = ExpressionHelper.GetPropertyName<DevJobworksheetT>(r => r.JobTeam);
			KeyJobPerson = ExpressionHelper.GetPropertyName<DevJobworksheetT>(r => r.JobPerson);
			KeyJobStatus = ExpressionHelper.GetPropertyName<DevJobworksheetT>(r => r.JobStatus);
			KeyJobStarttime = ExpressionHelper.GetPropertyName<DevJobworksheetT>(r => r.JobStarttime);
			KeyJobEndtime = ExpressionHelper.GetPropertyName<DevJobworksheetT>(r => r.JobEndtime);
			KeyJobFlag = ExpressionHelper.GetPropertyName<DevJobworksheetT>(r => r.JobFlag);
			KeyVerifyPerson = ExpressionHelper.GetPropertyName<DevJobworksheetT>(r => r.VerifyPerson);
			KeyJobHour = ExpressionHelper.GetPropertyName<DevJobworksheetT>(r => r.JobHour);
			KeyJobCost = ExpressionHelper.GetPropertyName<DevJobworksheetT>(r => r.JobCost);
			KeyJobDevicestop = ExpressionHelper.GetPropertyName<DevJobworksheetT>(r => r.JobDevicestop);
			KeyPersonCreated = ExpressionHelper.GetPropertyName<DevJobworksheetT>(r => r.PersonCreated);
			KeyGmtCreated = ExpressionHelper.GetPropertyName<DevJobworksheetT>(r => r.GmtCreated);
			KeyPersonModified = ExpressionHelper.GetPropertyName<DevJobworksheetT>(r => r.PersonModified);
			KeyGmtModified = ExpressionHelper.GetPropertyName<DevJobworksheetT>(r => r.GmtModified);
			KeyStateInfo = ExpressionHelper.GetPropertyName<DevJobworksheetT>(r => r.StateInfo);
			KeyIsUse = ExpressionHelper.GetPropertyName<DevJobworksheetT>(r => r.IsUse);
			KeyVersion = ExpressionHelper.GetPropertyName<DevJobworksheetT>(r => r.Version);
		}
		

		private long _id; 
		private long? _parentJob; 
		private string _jobCode; 
		private string _jobName; 
		private string _jobLevel; 
		private string _jobType; 
		private string _jobSubtype; 
		private string _jobTeam; 
		private string _jobPerson; 
		private string _jobStatus; 
		private DateTime? _jobStarttime; 
		private DateTime? _jobEndtime; 
		private byte? _jobFlag; 
		private string _verifyPerson; 
		private decimal? _jobHour; 
		private decimal? _jobCost; 
		private string _jobDevicestop; 
		private string _personCreated; 
		private DateTime? _gmtCreated; 
		private string _personModified; 
		private DateTime? _gmtModified; 
		private float? _stateInfo; 
		private int _isUse; 
		private long _version; 
		

		/// <summary>
		///  Id, column: id required
		/// </summary>
		[DisplayName("编码")]
		[Required]
		public long Id
		{
			get{ return _id; }
			set
			{
				if(_id != value)
				{
					_id = value;
					NotifyOfChange(KeyId);
				}
			}
		}

		/// <summary>
		///  ParentJob, column: parent_job 
		/// </summary>
		[DisplayName("父工单，如从故障工单生成维修工单")]
		public long? ParentJob
		{
			get{ return _parentJob; }
			set
			{
				if(_parentJob != value)
				{
					_parentJob = value;
					NotifyOfChange(KeyParentJob);
				}
			}
		}

		/// <summary>
		///  JobCode, column: job_code 
		/// </summary>
		[DisplayName("工单号")]
		public string JobCode
		{
			get{ return _jobCode; }
			set
			{
				if(_jobCode != value)
				{
					_jobCode = value;
					NotifyOfChange(KeyJobCode);
				}
			}
		}

		/// <summary>
		///  JobName, column: job_name 
		/// </summary>
		[DisplayName("工单名称")]
		public string JobName
		{
			get{ return _jobName; }
			set
			{
				if(_jobName != value)
				{
					_jobName = value;
					NotifyOfChange(KeyJobName);
				}
			}
		}

		/// <summary>
		///  JobLevel, column: job_level 
		/// </summary>
		[DisplayName("任务等级 严重、一般、常规等")]
		public string JobLevel
		{
			get{ return _jobLevel; }
			set
			{
				if(_jobLevel != value)
				{
					_jobLevel = value;
					NotifyOfChange(KeyJobLevel);
				}
			}
		}

		/// <summary>
		///  JobType, column: job_type 
		/// </summary>
		[DisplayName("工单类型 巡检计划、巡检故障、计划维修、突发维修、大修、计划养护等")]
		public string JobType
		{
			get{ return _jobType; }
			set
			{
				if(_jobType != value)
				{
					_jobType = value;
					NotifyOfChange(KeyJobType);
				}
			}
		}

		/// <summary>
		///  JobSubtype, column: job_subtype 
		/// </summary>
		[DisplayName("工单子类型 如普通巡检、地图巡检等")]
		public string JobSubtype
		{
			get{ return _jobSubtype; }
			set
			{
				if(_jobSubtype != value)
				{
					_jobSubtype = value;
					NotifyOfChange(KeyJobSubtype);
				}
			}
		}

		/// <summary>
		///  JobTeam, column: job_team 
		/// </summary>
		[DisplayName("负责班组")]
		public string JobTeam
		{
			get{ return _jobTeam; }
			set
			{
				if(_jobTeam != value)
				{
					_jobTeam = value;
					NotifyOfChange(KeyJobTeam);
				}
			}
		}

		/// <summary>
		///  JobPerson, column: job_person 
		/// </summary>
		[DisplayName("负责人")]
		public string JobPerson
		{
			get{ return _jobPerson; }
			set
			{
				if(_jobPerson != value)
				{
					_jobPerson = value;
					NotifyOfChange(KeyJobPerson);
				}
			}
		}

		/// <summary>
		///  JobStatus, column: job_status 
		/// </summary>
		[DisplayName("工单状态")]
		public string JobStatus
		{
			get{ return _jobStatus; }
			set
			{
				if(_jobStatus != value)
				{
					_jobStatus = value;
					NotifyOfChange(KeyJobStatus);
				}
			}
		}

		/// <summary>
		///  JobStarttime, column: job_starttime 
		/// </summary>
		[DisplayName("任务开始时间")]
		public DateTime? JobStarttime
		{
			get{ return _jobStarttime; }
			set
			{
				if(_jobStarttime != value)
				{
					_jobStarttime = value;
					NotifyOfChange(KeyJobStarttime);
				}
			}
		}

		/// <summary>
		///  JobEndtime, column: job_endtime 
		/// </summary>
		[DisplayName("任务结束时间")]
		public DateTime? JobEndtime
		{
			get{ return _jobEndtime; }
			set
			{
				if(_jobEndtime != value)
				{
					_jobEndtime = value;
					NotifyOfChange(KeyJobEndtime);
				}
			}
		}

		/// <summary>
		///  JobFlag, column: job_flag 
		/// </summary>
		[DisplayName("标记从计划生成、Web手动添加、APP或其它来源")]
		public byte? JobFlag
		{
			get{ return _jobFlag; }
			set
			{
				if(_jobFlag != value)
				{
					_jobFlag = value;
					NotifyOfChange(KeyJobFlag);
				}
			}
		}

		/// <summary>
		///  VerifyPerson, column: verify_person 
		/// </summary>
		[DisplayName("审核人")]
		public string VerifyPerson
		{
			get{ return _verifyPerson; }
			set
			{
				if(_verifyPerson != value)
				{
					_verifyPerson = value;
					NotifyOfChange(KeyVerifyPerson);
				}
			}
		}

		/// <summary>
		///  JobHour, column: job_hour 
		/// </summary>
		[DisplayName("工单工时")]
		public decimal? JobHour
		{
			get{ return _jobHour; }
			set
			{
				if(_jobHour != value)
				{
					_jobHour = value;
					NotifyOfChange(KeyJobHour);
				}
			}
		}

		/// <summary>
		///  JobCost, column: job_cost 
		/// </summary>
		[DisplayName("工单费用")]
		public decimal? JobCost
		{
			get{ return _jobCost; }
			set
			{
				if(_jobCost != value)
				{
					_jobCost = value;
					NotifyOfChange(KeyJobCost);
				}
			}
		}

		/// <summary>
		///  JobDevicestop, column: job_devicestop 
		/// </summary>
		[DisplayName("停机时长 小时")]
		public string JobDevicestop
		{
			get{ return _jobDevicestop; }
			set
			{
				if(_jobDevicestop != value)
				{
					_jobDevicestop = value;
					NotifyOfChange(KeyJobDevicestop);
				}
			}
		}

		/// <summary>
		///  PersonCreated, column: person_created 
		/// </summary>
		[DisplayName("创建人、编制人、报告人")]
		public string PersonCreated
		{
			get{ return _personCreated; }
			set
			{
				if(_personCreated != value)
				{
					_personCreated = value;
					NotifyOfChange(KeyPersonCreated);
				}
			}
		}

		/// <summary>
		///  GmtCreated, column: gmt_created 
		/// </summary>
		[DisplayName("创建时间")]
		public DateTime? GmtCreated
		{
			get{ return _gmtCreated; }
			set
			{
				if(_gmtCreated != value)
				{
					_gmtCreated = value;
					NotifyOfChange(KeyGmtCreated);
				}
			}
		}

		/// <summary>
		///  PersonModified, column: person_modified 
		/// </summary>
		[DisplayName("更新人")]
		public string PersonModified
		{
			get{ return _personModified; }
			set
			{
				if(_personModified != value)
				{
					_personModified = value;
					NotifyOfChange(KeyPersonModified);
				}
			}
		}

		/// <summary>
		///  GmtModified, column: gmt_modified 
		/// </summary>
		[DisplayName("更新时间")]
		public DateTime? GmtModified
		{
			get{ return _gmtModified; }
			set
			{
				if(_gmtModified != value)
				{
					_gmtModified = value;
					NotifyOfChange(KeyGmtModified);
				}
			}
		}

		/// <summary>
		///  StateInfo, column: state_info 
		/// </summary>
		[DisplayName("标识状态")]
		public float? StateInfo
		{
			get{ return _stateInfo; }
			set
			{
				if(_stateInfo != value)
				{
					_stateInfo = value;
					NotifyOfChange(KeyStateInfo);
				}
			}
		}

		/// <summary>
		///  IsUse, column: is_use 
		/// </summary>
		[DisplayName("是否可用")]
		[Required]
		public int IsUse
		{
			get{ return _isUse; }
			set
			{
				if(_isUse != value)
				{
					_isUse = value;
					NotifyOfChange(KeyIsUse);
				}
			}
		}

		/// <summary>
		///  Version, column: version 
		/// </summary>
		[DisplayName("版本")]
		[Required]
		public long Version
		{
			get{ return _version; }
			set
			{
				if(_version != value)
				{
					_version = value;
					NotifyOfChange(KeyVersion);
				}
			}
		}

		public event PropertyChangedEventHandler PropertyChanged;

		private void NotifyOfChange(string propertyName)
		{
			if (this.PropertyChanged != null)
			{
				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
			}
		}
	}
}
